<?php

class RowInfo {
	public $attribute;
	public $len;
	public $hight;
	public $dataSize;
	public $hideAttrib = 0;
	public $inputAttrib = 0;
	public $textareaAttrib = 0;

}

require "configs/smartmain.php";
require "configs/Mysql.class.php";
session_start ();

$columns = array ();

$action = $_REQUEST ["action"];

$c2 = 0;
$c3 = 0;

//echo "action: $action  <br />";


$rowSize = $_REQUEST ["rowSize"];

//echo "co:".$columnSize."<p>";
for($cc = 0; $cc < $rowSize; $cc ++) {
	$counter = "" . $cc;
	//echo "need".$counter."<p>";
	$one = new RowInfo ( );
	
	$one->attribute = $_REQUEST ["attribute" . $counter];
	//echo "attribute:".$one->attribute."<p>";
	$one->len = $_REQUEST ["len" . $counter];
	$one->hight = $_REQUEST ["tHigh" . $counter];
	$one->dataSize = $_REQUEST ["dataSize" . $counter];
	if (isset ( $_REQUEST ["hide" . $counter] )) {
		$one->hideAttrib = 1;
	}
	if (isset ( $_REQUEST ["input" . $counter] )) {
		$one->inputAttrib = 1;
	}
	if (isset ( $_REQUEST ["textarea" . $counter] )) {
		$one->textareaAttrib = 1;
	}
	if (isset ( $_REQUEST ["doit" . $counter] )) {
		$columns [$c2] = $one;
		$c2 ++;
	}

}

$dataObjectName = "";
if (isset ( $_REQUEST ["dataObjectName"] )) {
	$dataObjectName = $_REQUEST ["dataObjectName"] . "->";
	//escape
}

$template->assign ( "dataObjectName", $dataObjectName );

$template->assign ( "className", $_REQUEST ["className"] );

$template->assign ( "attributes", $columns );

$template->assign ("lsm",$_REQUEST ["left_smart"]);
$template->assign ("rsm",$_REQUEST ["right_smart"]);

if ($action == "phpcode") {
	
	$template->display ( 'OtherPhpCoder.tpl.html' );
} else if ($action == "htmlEdit") {
	
	$template->assign ( "inputTextLimit", $_REQUEST ["inputTextLimit"] );
	if (isset ( $_REQUEST ["tableFormat"] )) {
		//echo "tableformat <br //>";
		$template->assign ( "tableFlag", "1" );
		$template->assign ( "class1", $_REQUEST ["class1"] );
		$template->assign ( "class2", $_REQUEST ["class2"] );
	
	} else {
		$template->assign ( "tableFlag", "0" );
	
	}
	$template->display ( 'OtherHtmlEdit.tpl.html' );
} 

else if ($action == "htmlList") {
	
	$template->assign ( "class1", $_REQUEST ["listClass1"] );
	$template->assign ( "class2", $_REQUEST ["listClass2"] );
	$template->assign ( "arrayName", $_REQUEST ["arrayName"] );
	
	$template->assign ( "insideForeachItemName", $_REQUEST ["insideForeachItemName"] );
	
	if (isset ( $_REQUEST ["httpurl"] ) && $_REQUEST ["httpurl"] != "") {
		$template->assign ( "httpurl", "<a href=\"" . $_REQUEST ["httpurl"] . "\" target=\"" . $_REQUEST ["target"] . "\">" );
	} else {
		$template->assign ( "httpurl", "" );
	}
	
	$template->display ( 'OtherHtmlList.tpl.html' );
}

?>
